﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TjZheng.Domain.Business;
using TjZheng.Domain.DataEntity;
using TjZheng.Framework;

namespace TjZheng.SyncBBSRedis
{
    public class DbSetProcess
    {
        protected DbSetInfo DbSetInfo { get; set; }
        public DbSetProcess()
        {
            BizDbSetInfo objBizDbSetInfo = new BizDbSetInfo();
            this.DbSetInfo = objBizDbSetInfo.GetRecord("SetCode=@SetCode", "SetCode".CreateSqlParameters(ConfigHelper.GetValue("BBSName")));
            if (this.DbSetInfo == null)
            {
                throw new Exception("对不起，未找到论坛名称为" + this.DbSetInfo.SetCode + "的数据配置");
            }
        }

        public string BBSName
        {
            get
            {
                return this.DbSetInfo.SetCode;
            }
        }

        public string ConnectionStringKey
        {
            get
            {
                return this.DbSetInfo.ConnectionString;
            }
        }
    }
}
